package com.maywide.jdp.system.vo;

import java.io.Serializable;

import com.google.gson.annotations.Expose;

/**
 * 菜单树对象类
 * 
 * @author luoyang
 * @version 1.0
 * @since JDK1.6
 */
public class MenuTree implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6781685808954449372L;
	
	/**
	 * ID
	 */
	@Expose
	protected String id = null;
	
	/**
	 * 编码
	 */
	@Expose
	protected String code = null;
	
	/**
	 * 名称
	 */
	@Expose
	protected String name = null;
	
	/**
	 * 描述
	 */
	@Expose
	protected String description = null;
	
	/**
	 * 可用
	 */
	@Expose
	protected boolean active = true;

	/**
	 * 文本
	 */
	@Expose
	protected String text = null;
	
	/**
	 * 顺序
	 */
	@Expose
	protected int tabIndex = 0;

	/**
	 * 图标
	 */
	@Expose
	protected String menuIcon = null;

	/**
	 * 图标类
	 */
	@Expose
	protected String menuIconCls = null;
	
	/**
	 * 访问的url
	 */
	@Expose
	protected String url = null;
	
	/**
	 * 打开窗口的宽度
	 */
	@Expose
	protected int width = 0;
	
	/**
	 * 打开窗口的高度
	 */
	@Expose
	protected int height = 0;

	/**
	 * 父菜单
	 */
	@Expose
	protected String parentID = null;
	
	/**
	 * 是否叶子
	 */
	@Expose
	protected boolean leaf = false;

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the active
	 */
	public boolean isActive() {
		return active;
	}

	/**
	 * @param active the active to set
	 */
	public void setActive(boolean active) {
		this.active = active;
	}
	
	/**
	 * @return tabIndex
	 */
	public int getTabIndex() {
		return tabIndex;
	}

	/**
	 * @param tabIndex
	 * 		要配置的 tabIndex
	 */
	public void setTabIndex(int tabIndex) {
		this.tabIndex = tabIndex;
	}

	/**
	 * @return the text
	 */
	public String getText() {
		return text;
	}

	/**
	 * @param text the text to set
	 */
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * @return the width
	 */
	public int getWidth() {
		return width;
	}

	/**
	 * @param width the width to set
	 */
	public void setWidth(int width) {
		this.width = width;
	}

	/**
	 * @return the height
	 */
	public int getHeight() {
		return height;
	}

	/**
	 * @param height the height to set
	 */
	public void setHeight(int height) {
		this.height = height;
	}

	/**
	 * @return url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url
	 * 		要配置的 url
	 */
	public void setUrl(String clientFunction) {
		this.url = clientFunction;
	}

	/**
	 * @return iconCls
	 */
	public String getMenuIconCls() {
		return menuIconCls;
	}

	/**
	 * @param iconCls
	 * 		要配置的 iconCls
	 */
	public void setMenuIconCls(String iconCls) {
		this.menuIconCls = iconCls;
	}

	/**
	 * @return icon
	 */
	public String getMenuIcon() {
		return menuIcon;
	}

	/**
	 * @param menuIcon
	 * 		要配置的 icon
	 */
	public void setMenuIcon(String aIcon) {
		menuIcon = aIcon;
	}

	/**
	 * @return 返回 parentID。
	 */
	public String getParentID() {
		return parentID;
	}

	/**
	 * @param parentID
	 * 		要配置的 parentID
	 */
	public void setParentID(String parentID) {
		this.parentID = parentID;
	}

	/**
	 * @param leaf the leaf to set
	 */
	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	/**
	 * @return the leaf
	 */
	public boolean isLeaf() {
		return leaf;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof MenuTree) {
			if(((MenuTree)obj).getId().equals(id))
				return true;
		}
		return false;
	}
}
